<script setup>
import { provide, ref } from 'vue';
import Parent from './components/parent.vue'
const count = ref(0)
const updateCount = () => {
  count.value++
}

// 给后代组件提供数据
provide('count', count)
provide('updateCount', updateCount)

</script>

<template>
  <div>
    这是最外层的页面 {{ count }}
    <button @click="updateCount">外层页面控制数据</button>
    <Parent/>
  </div>
</template>